package com.limao.push;

import java.util.ArrayList;

import com.limao.Admin.DataClass.AdminSysMessClass;
import com.limao.CacheManager.CrowdUserAuthCache;
import com.limao.DBDataClass.SysCidDataClass;
import com.limao.Tool.CacheClass;

//消息文本内容模板
public class pushToAPPTemplate {
  

    //新的推广积分消息通知
	public static void NewMess_InviteCutRmb(int touserid,int level,String username,float rmb)
	{
		String levelStr="";
		switch(level)
		{
		case 0:
			levelStr="【同类】";
			break;
		case 1:
			levelStr="【A类】";
			break;
		case 2:
			levelStr="【B类】";
			break;
		case 3:
			levelStr="【C类】";
			break;
		default:
				
		}
		levelStr="【团队成员】";
		
		String titel="您有新的推广积分";
		String txt="您新增加"+levelStr+"新用户"+username+"，获得推广积分【"+CacheClass.GetDouble_2(rmb)+"】积分。";
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="1";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}
	
	
	
    //推广积分解冻消息通知
	public static void NewMess_InviteCutRmb_Freeze(int touserid,int level,String username,float rmb)
	{
		String levelStr="";
		switch(level)
		{
		case 0:
			levelStr="【同类】";
			break;
		case 1:
			levelStr="【A类】";
			break;
		case 2:
			levelStr="【B类】";
			break;
		case 3:
			levelStr="【C类】";
			break;
		default:
				
		}
		levelStr="【团队成员】";
		
		String titel="您有推广积分解冻了";
		String txt="您的"+levelStr+"用户"+username+"，成功激活积分规则，解冻了您原来被冻结的推广积分【"+CacheClass.GetDouble_2(rmb)+"】积分，";
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="1";
		
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
	}

	


	
    //新鲜宝 新的购物分成积分消息通知
	public static void NewMess_BuyCutRmb(int touserid,int level,String username,String goodsname,float rmb)
	{
		String levelStr="";
		switch(level)
		{
		case 0:
			levelStr="【同类】";
			break;
		case 1:
			levelStr="【A类】";
			break;
		case 2:
			levelStr="【B类】";
			break;
		case 3:
			levelStr="【C类】";
			break;
		default:
				
		}
		levelStr="【团队成员】";

		String titel="您有新的分成";
		String txt="您的"+levelStr+"用户"+username+"，购买【"+goodsname+"】商品成功，您获得分成【"+CacheClass.GetDouble_2(rmb)+"】元。";
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="1";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}
	
	
	 //新鲜宝 新的购物分成   得瓶数  消息通知
	public static void NewMess_BuyCutNum(int touserid,int level,String username,String goodsname,float vrgoodsnum)
	{
		String levelStr="";
		switch(level)
		{
		case 0:
			levelStr="【同类】";
			break;
		case 1:
			levelStr="【A类】";
			break;
		case 2:
			levelStr="【B类】";
			break;
		case 3:
			levelStr="【C类】";
			break;
		default:
				
		}
		levelStr="【团队成员】";

		String titel="您有新的分成";
		String txt="您的"+levelStr+"用户"+username+"，购买【"+goodsname+"】商品成功，您获分成得【现货数量】【"+CacheClass.GetDouble_2(vrgoodsnum)+"】瓶。";
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="1";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}
	
	//新鲜宝 新的购物分成   宝箱 消息通知
	public static void NewMess_BuyCutRedbag(int touserid,int level,String username,String goodsname)
	{
		String levelStr="";
		switch(level)
		{
		case 0:
			levelStr="【同类】";
			break;
		case 1:
			levelStr="【A类】";
			break;
		case 2:
			levelStr="【B类】";
			break;
		case 3:
			levelStr="【C类】";
			break;
		default:
				
		}
		levelStr="【团队成员】";

		String titel="您获得新的【宝箱】";
		String txt="您的"+levelStr+"用户"+username+"，购买【"+goodsname+"】商品成功，您获得【宝箱】一个，快去试手气吧。";
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="3";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}
	
    //新的购物分成积分消息通知
	public static void NewMess_BuyCutRmb2(int touserid,int level,String username,String goodsname,int freeze,float rmb)
	{
		String levelStr="";
		switch(level)
		{
		case 0:
			levelStr="【同类】";
			break;
		case 1:
			levelStr="【A类】";
			break;
		case 2:
			levelStr="【B类】";
			break;
		case 3:
			levelStr="【C类】";
			break;
		default:
				
		}
		levelStr="【团队成员】";
		String typetxt="";
		if(freeze==0){ //冻结
			typetxt="冻结性";
		}
		else //正常
		{
			typetxt="正常性";
		}
		String titel="您有新的购物补贴";
		String txt="您的"+levelStr+"用户"+username+"，购买"+goodsname+"成功，您获得"+typetxt+"购物补贴【"+CacheClass.GetDouble_2(rmb)+"】积分。";
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="1";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}
	
    //购物分成积分解冻消息通知
	public static void NewMess_BuyCutRmb_Freeze(int touserid,int level,String username,float rmb)
	{
		String levelStr="";
		switch(level)
		{
		case 0:
			levelStr="【同类】";
			break;
		case 1:
			levelStr="【A类】";
			break;
		case 2:
			levelStr="【B类】";
			break;
		case 3:
			levelStr="【C类】";
			break;
		default:
				
		}
		levelStr="【团队成员】";
		String titel="您有购物积分解冻了";
		String txt="您的"+levelStr+"用户"+username+"，成功激活积分规则，解冻了您原来被冻结的购物积分【"+CacheClass.GetDouble_2(rmb)+"】积分，";
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="1";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
	}
	
	public static void NewMess_BuyCutRmb_Freeze2(int touserid,int level,String username,float rmb)
	{
		String levelStr="";
		switch(level)
		{
		case 0:
			levelStr="【同类】";
			break;
		case 1:
			levelStr="【A类】";
			break;
		case 2:
			levelStr="【B类】";
			break;
		case 3:
			levelStr="【C类】";
			break;
		default:
				
		}
		levelStr="【团队成员】";
		String titel="您有购物补贴解冻了";
		String txt="您的"+levelStr+"用户"+username+"，成功激活积分规则，解冻了您原来购物补贴【"+CacheClass.GetDouble_2(rmb)+"】积分，";
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="1";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
	} 
	
	//推荐店铺销售积分消息通知
	public static void NewMess_ShopCutRmb(int touserid,float rmb)
	{
		
		String titel="您获得推荐店铺销售积分";
		String txt="您推荐的店铺刚完成一订单销售，您获得该店铺分成【"+CacheClass.GetDouble_2(rmb)+"】积分。";
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="1";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}
	
	//提现消息通知
	public static void NewMess_WithDrawRmb(int touserid,float rmb,int state)
	{
		
		String titel="";
		String txt="";
		switch(state)
		{
		case 0:
			titel="您的提现申请 收到";
			txt="您的提现申请【"+CacheClass.GetDouble_2(rmb)+"】元,系统已收到，请耐心等待工作人员处理。";
			break;
		case 1:
			titel="您的提现申请 已通过审核";
			txt="您的提现申请【"+CacheClass.GetDouble_2(rmb)+"】元,已通过审核，请等待工作人员处理。";
			break;
		case 2:
			titel="您的提现申请 已完成";
			txt="您的提现申请【"+CacheClass.GetDouble_2(rmb)+"】元,已完成，请核对你的帐号资金。";
			break;	
		case 3:
			titel="您的提现申请 被拒绝";
			txt="您的提现申请【"+CacheClass.GetDouble_2(rmb)+"】元,已被系统拒绝完成，请联系工作人员处理。";
			break;				
		}
		
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="2";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}

	
	
	//购物消费 消息通知
	public static void NewMess_BuyGoodsRmb(int touserid,float rmb)
	{

		String titel="您的资金变动";
		String txt="您的资金，因商城购物消费减少【"+CacheClass.GetDouble_2(rmb)+"】元。";
			
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="1";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}
	
	//购物消费 非vip损失 消息通知
	public static void NewMess_LostRmbBuyGoodsRmb(int touserid,int level,String username,String goodsname,int freeze,float rmb)
	{
		String levelStr="";
		switch(level)
		{
		case 0:
			levelStr="【同类】";
			break;
		case 1:
			levelStr="【A类】";
			break;
		case 2:
			levelStr="【B类】";
			break;
		case 3:
			levelStr="【C类】";
			break;
		default:
				
		}
		
		String titel="积分损失提配";
		String txt="您的"+levelStr+"用户"+username+"，购买"+goodsname+"成功，触发物购积分分成，因你是非vip用户，购物积分分成未正常得到，损失【"+rmb+"】积分。请升级VIP，获取更多积分！";
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="1";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();

	}

	//收到红包 消息通知
	public static void NewMess_recvRedbag(int touserid,int level,String username,String goodsname)
	{
		String levelStr="";
		switch(level)
		{
		case 0:
			levelStr="【同类】";
			break;
		case 1:
			levelStr="【A类】";
			break;
		case 2:
			levelStr="【B类】";
			break;
		case 3:
			levelStr="【C类】";
			break;
		default:
				
		}
		String titel="新的红包";
		String txt="您的"+levelStr+"用户"+username+"，购买商品【"+goodsname+"】成功，您获得【红包】一个";
			
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="3";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}	
	
	//打开红包 积分增加 消息通知
	public static void NewMess_OpenRedbagRmb(int touserid,float rmb)
	{

		String titel="您的积分增加";
		String txt="您的积分，因打开红包中奖，积分增加【"+CacheClass.GetDouble_2(rmb)+"】积分。";
			
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="1";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}	
	
	//发货  消息通知
	public static void NewMess_OrderCourier(int touserid, String order_sn,String courierComp,String courierOrder)
	{
		String titel="您的订单已发货";
		String txt="您的订单【"+order_sn+"】，已发货，请注意查收，物流公司【"+courierComp+"】,物流单号【"+courierOrder+"】。";
			
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="2";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}
	
	//发给供应商的　有新待发货订单  消息通知
	public static void NewMess_OrderCourier_ForSupplier(ArrayList<Integer> useridList)
	{
		String titel="您有新的【待发货】订单，需要发货。";
		String txt="请登陆【管理后台】，进行查看与发货！";
			
		for(int touserid:useridList)
		{
			AdminSysMessClass obj=new AdminSysMessClass();
			obj.title=titel;
			obj.txt=txt;
			obj.type="0";
			obj.icontype="2";
			obj.userid=touserid+"";
			ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
			
			pushtoAPP d=new pushtoAPP(cidList,titel,obj);
			d.start();
		}

		
	}
	
	//注册获得活跃消息
	public static void NewMess_InvitePreCut(int touserid,String username,int prestigevalue,int type)
	{
		String typeStr="";
		switch(type)
		{
		case 0:
			typeStr="注册";
			break;
		case 1:
			typeStr="商城购物";
			break;
		default:
			typeStr="每日签到";
			break;
		}
	
		String titel="您获得了活跃";
		String txt="因为您【团队成员】"+username+"，"+typeStr+"成功，您获得奖励【"+prestigevalue+"】点活跃。";
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="3";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}
	
	//活跃物品回购
	public static void NewMess_CallBuy(int touserid,float rmb)
	{

		String titel="回购成功";
		String txt="您的活跃物品回购成功,收益变动，增加【"+CacheClass.GetDouble_2(rmb)+"】元。";
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="1";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}

	public static void NewMess_CallVrInFounds(int touserid,String txt)
	{

		String titel="入金成功!";
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="3";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}
	
	public static void NewMess_CallVrOutFounds(int touserid,String txt)
	{

		String titel="出金成功!";
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="3";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}
	
	public static void NewMess_CallVrCallBack(int touserid,float rmb)
	{

		String titel="回购成功";
		String txt="您的物品回购成功，增加【"+CacheClass.GetDouble_2(rmb)+"】狸猫豆。";
		
		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="3";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}
	
	public static void NewMess1(int touserid,String titel,String txt)
	{


		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="1";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}
	
	public static void NewMess2(int touserid,String titel,String txt)
	{


		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="2";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}
	
	public static void NewMess3(int touserid,String titel,String txt)
	{


		AdminSysMessClass obj=new AdminSysMessClass();
		obj.title=titel;
		obj.txt=txt;
		obj.type="0";
		obj.icontype="3";
		obj.userid=touserid+"";
		
		ArrayList<SysCidDataClass> cidList=CrowdUserAuthCache.getInstance().getUserCidById(touserid);
		
		pushtoAPP d=new pushtoAPP(cidList,titel,obj);
		d.start();
		
	}
	
}
